Telecom Churn Analysis

Importing Libraries

Reading Dataset

Description of Columns

• State: US state in which the customer resides

• Account length: The number of days that this account has been active

• Area code: The three-digit area code of the corresponding customer’s phone number

• International plan: Customer has an international calling plan: YES / NO

• Voice mail plan: Customer has a voice mail feature: YES / NO

• Number vmail messages: average number of voice mail messages per month

• Total day minutes: total number of calling minutes used during the day

• Total day calls: total number of calls placed during the day

• Total day charge: billed cost of daytime calls

• Total eve minutes: total number of calling minutes used during the evening

• Total eve calls: total number of calls placed during the evening

• Total eve charge: billed cost of evening time calls

• Total night minutes: total number of calling minutes used during the night

• Total night calls: the total number of calls placed during the night

• Total night charge: the billed cost of nighttime calls

• Total intl minutes: total number of international minutes

• Total intl calls: total number of international calls

• Total intl charge: billed cost for international calls

• Customer service calls: number of calls placed to Customer Service

• Churn: whether the customer left the service: True/False

Getting Information About Dataset

Basic Statistics of Data

Checking for Unique Values for States , Area Code , International plan , Voice mail plan

Cleaning

Checking for Null Values

There is No Null Values in Dataset

So, We can go for EDA

For Target Replacing True and False with 0 & 1 Accordingly

Probability of Custumer Left The Services is 14%

Plotting Historams for All the Columns

Here from Histogram we can say that in Columms of Account length , Total day minutes , Total day calls , Total day charge , Total eve minutes ,Total eve calls, Total eve charg , Total night minutes , Total night calls , Total night charge , Total intl minutes & Total intl charge

Most Data Lie Near Mean & Median

Countplot of Churn

Less than 500 Customers Left the Services

Top 10 States Who Left the Sevices

Graph Shows Probability of State who Left The Services

Countplot for Customer Service Calls

Countplot for Customer Area Code

Counts of Customes Having International Plans & Voice Mail Plan

Count of Customer Who Purchased International Plajn / Voice mail Plan with Respect to Churn

1.Probability of Leaving Services Who have International Plan or Not

2.Probability of Leaving Services Who have Voice Mail Plan or Not

Scatterplot of Total day minutes & Total night minutes with respect to Churn

Scatterplot of Total day Calls & Total night Calls with respect to Churn

Pairplot of Data

Getting Correlation By Heatmap

Boxplot of Total International Minutes

Boxplot of Total Evening Minutes

Average Total Day Charges with Respect To Churn

The Charges are Higher for Customers who Left Services

There is no such Difference in Usage of Minutes in night

We can go for Machine learning Model

Here some columns are Categorical So, Label encoding is Required

Scaling Data

Defining Objects For Features And Target

Splitting Data for Training And Testing

Trying All Models on Data For Getting Best Accuracy

Best Accuracuy In Classification Algorithms is 96% in XgBoost and f1 Score is 0.83

Dumping Model

Algorithms for Clustering

Kmeans Clustering

Checking silhouette_score

Hirearchical Clustering